/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javalens.featurecalculators;

import javalens.astronomy.LightCurve;
import javalens.*;
import javalens.featurecalculators.FeatureCalculator;
import javalens.util.CalculationException;
import javalens.util.Util;

/**
 *
 * @author vermaak
 */
public class PolyFitFeatureCalculator implements FeatureCalculator {


    public String[] getHeaders() {
        return new String[]{
            "logLineChisq", "offset", "slope",
            "logParabolaChisq", "parabolaYAxis",
            "logCubicChisq",
            "logQuarticChisq",
            "logQuinticChisq"
        };
    }

    public double[] getValues(LightCurve curve) throws CalculationException {
        double[] x = curve.getDays();
        double[] y = curve.getMags();
        double[] ret = Util.fitFivePolynomials(x,y);
        return ret;
    }
}
